﻿using IceDog.Uop.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IceDog.Uop.Models
{
    /// <summary>
    /// 性别枚举
    /// </summary>
    public enum Gender
    {
        /// <summary>
        /// 保密
        /// </summary>
        Secret,
        /// <summary>
        /// 男
        /// </summary>
        Man,
        /// <summary>
        /// 女
        /// </summary>
        Woman,
        
    }
    public class User
    {
        public User()
        {
            JoinDate = DateTime.Now;
            Guid = GUIDHelper.GuidString;
            IsDeleted = false;
            Remark = string.Empty;
        }
        /// <summary>
        /// 用户Id
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]//主键，自动递增
        public int Id { get; set; }
        /// <summary>
        /// 用户Guid
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        public string Guid { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public Gender Gender { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public ushort Age { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string MobilePhone { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime Birthday { get; set; }
        /// <summary>
        /// 录入时间
        /// <para>[可以不用赋值，内部赋值]</para>
        /// </summary>
        public DateTime JoinDate { get;}
        /// <summary>
        /// 是否已删除
        /// </summary>
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 订单集合
        /// </summary>
        public IList<Order> Orders { get; set; }
    }
}
